import request from '@/utils/request'
import type { AddNoteDTO, UpdateNoteDTO } from '@/api/DTO/note'
const baseURL = '/note'

//1. 获取一篇笔记
export const getNoteServer = (noteId: any) => {
  return request.get(baseURL, { params: { noteId } })
}
//2. 新增一篇笔记
export const addNoteServer = (data: AddNoteDTO) => {
  return request.post(baseURL, data)
}
//3. 修改一篇笔记
export const updateNoteServer = (data: UpdateNoteDTO) => {
  return request.put(baseURL, data)
}
//4. 删除一篇笔记
export const deleteNoteServer = (noteId: any) => {
  return request.delete(baseURL + '/delete', { params: { noteId } })
}
